﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Rüdiger_Baustein4
{
    class cBaustein
    {
        protected int i;

        public int I
        {
            get { return i; }
            set { i = value; }
        }
        protected int iAnzEin = 0;
        public int IAnzEin
        {
            get { return iAnzEin; }
            set { iAnzEin = value; }
        }
        protected bool bAus = false;
        public bool BAus
        {
            get { return bAus; }
            set { bAus = value; }
        }
        protected bool[] bEingaenge;
        protected bool[] bInvertiert;
        protected string strName = "";
        public string StrName
        {
            get { return strName; }
            set { strName = value; }
        }

        public cBaustein(int IEin, string StrName)
        {
            iAnzEin = IEin;
            strName = StrName;
            bEingaenge = new bool[iAnzEin];
            bInvertiert = new bool[iAnzEin];
            for (int i = 0; i < iAnzEin; i++)
            {
                bEingaenge[i] = false;
            }
        }
        public cBaustein() { }

        internal string report()
        {
            string strErgebnis = strName + "\r\n";
            for (int i = 0; i < iAnzEin; i++)
            {
                strErgebnis += "Der Eingang:  " + Convert.ToString(i) +
                    "  hat den Wert: " + Convert.ToString(bEingaenge[i])
                    + "  der Ausgang:  " + Convert.ToString(bAus) + "\r\n";

            }
            return strErgebnis;
        }
        public void set(int i, bool b)
        {
            if ((i < bEingaenge.Length) && (i >= 0))
            {
                bEingaenge[i] = b;
            }
        }
    }
}